<template>
  <div>
    <div v-if="lnglat.length>1">
      <div>{{address}}</div>
      <input type="text" v-model="detail">
    </div>
    <button @click="chooseLocation">选择</button>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        lnglat: [],
        address: '',
        detail: '',
      }
    },
    methods: {
      chooseLocation() {
        wx.chooseLocation({
          success: data=> {
            this.lnglat = [data.longitude, data.latitude]
            this.address = data.address
          },
          fail: e=> {
            console.log(e);
            
          }
        })
      },
    },
  }
</script>

<style scoped>

</style>